{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "from setting import get_engine\n",
    "import pandas as pd\n",
    "engine = get_engine('db_stock')\n",
    "df = pd.read_sql('tb_delivery_GJ',engine,index_col=u'成交日期')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>成交时间</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>操作</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交均价</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>余额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>本次金额</th>\n",
       "      <th>其他费用</th>\n",
       "      <th>交易市场</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>成交日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2018-02-05</th>\n",
       "      <td>13:29:51</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-100</td>\n",
       "      <td>24.96</td>\n",
       "      <td>2496.0</td>\n",
       "      <td>105.0</td>\n",
       "      <td>2488.50</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.50</td>\n",
       "      <td>0.05</td>\n",
       "      <td>2488.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-02-07</th>\n",
       "      <td>14:35:30</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>100</td>\n",
       "      <td>23.94</td>\n",
       "      <td>2394.0</td>\n",
       "      <td>205.0</td>\n",
       "      <td>-2399.00</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-02-26</th>\n",
       "      <td>11:22:45</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-105</td>\n",
       "      <td>23.26</td>\n",
       "      <td>2442.3</td>\n",
       "      <td>100.0</td>\n",
       "      <td>2434.86</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.44</td>\n",
       "      <td>0.05</td>\n",
       "      <td>2435.36</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-02-27</th>\n",
       "      <td>10:10:03</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-100</td>\n",
       "      <td>23.05</td>\n",
       "      <td>2305.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>2297.69</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.31</td>\n",
       "      <td>0.05</td>\n",
       "      <td>2463.05</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-02-27</th>\n",
       "      <td>10:01:22</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>100</td>\n",
       "      <td>22.65</td>\n",
       "      <td>2265.0</td>\n",
       "      <td>200.0</td>\n",
       "      <td>-2270.00</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.05</td>\n",
       "      <td>165.36</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                成交时间    证券代码  证券名称    操作  成交数量   成交均价    成交金额     余额     发生金额  \\\n",
       "成交日期                                                                            \n",
       "2018-02-05  13:29:51  300527  华舟应急  证券卖出  -100  24.96  2496.0  105.0  2488.50   \n",
       "2018-02-07  14:35:30  300527  华舟应急  证券买入   100  23.94  2394.0  205.0 -2399.00   \n",
       "2018-02-26  11:22:45  300527  华舟应急  证券卖出  -105  23.26  2442.3  100.0  2434.86   \n",
       "2018-02-27  10:10:03  300527  华舟应急  证券卖出  -100  23.05  2305.0  100.0  2297.69   \n",
       "2018-02-27  10:01:22  300527  华舟应急  证券买入   100  22.65  2265.0  200.0 -2270.00   \n",
       "\n",
       "            手续费   印花税   过户费     本次金额  其他费用  交易市场  \n",
       "成交日期                                              \n",
       "2018-02-05  5.0  2.50  0.05  2488.50   0.0  深圳Ａ股  \n",
       "2018-02-07  5.0  0.00  0.05     0.50   0.0  深圳Ａ股  \n",
       "2018-02-26  5.0  2.44  0.05  2435.36   0.0  深圳Ａ股  \n",
       "2018-02-27  5.0  2.31  0.05  2463.05   0.0  深圳Ａ股  \n",
       "2018-02-27  5.0  0.00  0.05   165.36   0.0  深圳Ａ股  "
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "12.43"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[u'证券代码']==u'123005'][u'手续费'].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>成交时间</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>操作</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交均价</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>余额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>本次金额</th>\n",
       "      <th>其他费用</th>\n",
       "      <th>交易市场</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>成交日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2018-03-16</th>\n",
       "      <td>14:03:41</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>50</td>\n",
       "      <td>123.680</td>\n",
       "      <td>6184.00</td>\n",
       "      <td>50.0</td>\n",
       "      <td>-6184.49</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3901.25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-19</th>\n",
       "      <td>10:59:31</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>124.500</td>\n",
       "      <td>6225.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6224.50</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>10148.33</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-23</th>\n",
       "      <td>14:49:25</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>120.190</td>\n",
       "      <td>6009.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6009.02</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9203.43</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-23</th>\n",
       "      <td>13:23:42</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>50</td>\n",
       "      <td>120.789</td>\n",
       "      <td>6039.45</td>\n",
       "      <td>50.0</td>\n",
       "      <td>-6039.93</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3194.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-26</th>\n",
       "      <td>14:30:29</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>122.650</td>\n",
       "      <td>6132.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6132.01</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6132.96</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-26</th>\n",
       "      <td>09:40:35</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>50</td>\n",
       "      <td>120.600</td>\n",
       "      <td>6030.00</td>\n",
       "      <td>50.0</td>\n",
       "      <td>-6030.48</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.95</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-27</th>\n",
       "      <td>10:05:12</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>126.680</td>\n",
       "      <td>5067.20</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5067.61</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-4030.68</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-27</th>\n",
       "      <td>10:32:37</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>126.950</td>\n",
       "      <td>5078.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5077.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1046.91</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:19:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.900</td>\n",
       "      <td>3747.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3747.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1210.87</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>14:00:45</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.600</td>\n",
       "      <td>3738.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3738.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1257.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:24:24</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>125.500</td>\n",
       "      <td>3765.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3764.70</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4975.57</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:16:02</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>125.100</td>\n",
       "      <td>3753.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3752.70</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4988.77</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:56:59</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.200</td>\n",
       "      <td>3726.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3726.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1262.47</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>14:45:58</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>10</td>\n",
       "      <td>124.890</td>\n",
       "      <td>1248.90</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-1249.00</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>11:08:49</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.640</td>\n",
       "      <td>3739.20</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3739.50</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1236.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:58:40</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>124.451</td>\n",
       "      <td>3733.53</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3733.23</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4995.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>09:33:44</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>125.000</td>\n",
       "      <td>5000.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4999.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5008.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:43:35</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>20</td>\n",
       "      <td>123.370</td>\n",
       "      <td>2467.40</td>\n",
       "      <td>20.0</td>\n",
       "      <td>-2467.60</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2545.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>10:00:40</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>124.360</td>\n",
       "      <td>4974.40</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4974.80</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>33.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>10:32:24</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>124.500</td>\n",
       "      <td>4980.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4979.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5012.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>14:13:57</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>123.500</td>\n",
       "      <td>4940.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4940.40</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>74.16</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:45:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>20</td>\n",
       "      <td>123.502</td>\n",
       "      <td>2470.04</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-2470.24</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>74.96</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:58:43</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>123.500</td>\n",
       "      <td>4940.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4939.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5014.56</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:44:14</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>129.250</td>\n",
       "      <td>5170.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5170.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>29.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:44:59</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>129.500</td>\n",
       "      <td>5180.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5179.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5209.29</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>10:02:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>123.550</td>\n",
       "      <td>4942.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4941.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5015.76</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:23:42</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>128.250</td>\n",
       "      <td>5130.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5130.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>49.74</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:32:43</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>129.400</td>\n",
       "      <td>5176.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5176.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:28:44</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>128.690</td>\n",
       "      <td>5147.60</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5147.19</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5196.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:15:16</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>127.801</td>\n",
       "      <td>5112.04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5111.63</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5180.15</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>13:04:57</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>123.671</td>\n",
       "      <td>4946.84</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4947.24</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>68.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:41:48</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>129.500</td>\n",
       "      <td>5180.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5179.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5200.11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-19</th>\n",
       "      <td>13:39:02</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>130.220</td>\n",
       "      <td>5208.80</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5209.22</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-4999.98</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                成交时间    证券代码  证券名称    操作  成交数量     成交均价     成交金额    余额  \\\n",
       "成交日期                                                                     \n",
       "2018-03-16  14:03:41  123005  万信转债  证券买入    50  123.680  6184.00  50.0   \n",
       "2018-03-19  10:59:31  123005  万信转债  证券卖出   -50  124.500  6225.00   0.0   \n",
       "2018-03-23  14:49:25  123005  万信转债  证券卖出   -50  120.190  6009.50   0.0   \n",
       "2018-03-23  13:23:42  123005  万信转债  证券买入    50  120.789  6039.45  50.0   \n",
       "2018-03-26  14:30:29  123005  万信转债  证券卖出   -50  122.650  6132.50   0.0   \n",
       "2018-03-26  09:40:35  123005  万信转债  证券买入    50  120.600  6030.00  50.0   \n",
       "2018-03-27  10:05:12  123005  万信转债  证券买入    40  126.680  5067.20  40.0   \n",
       "2018-03-27  10:32:37  123005  万信转债  证券卖出   -40  126.950  5078.00   0.0   \n",
       "2018-04-16  10:19:53  123005  万信转债  证券买入    30  124.900  3747.00  30.0   \n",
       "2018-04-16  14:00:45  123005  万信转债  证券买入    30  124.600  3738.00  30.0   \n",
       "2018-04-16  10:24:24  123005  万信转债  证券卖出   -30  125.500  3765.00   0.0   \n",
       "2018-04-16  13:16:02  123005  万信转债  证券卖出   -30  125.100  3753.00   0.0   \n",
       "2018-04-16  13:56:59  123005  万信转债  证券买入    30  124.200  3726.00  30.0   \n",
       "2018-04-16  14:45:58  123005  万信转债  证券买入    10  124.890  1248.90  40.0   \n",
       "2018-04-16  11:08:49  123005  万信转债  证券买入    30  124.640  3739.20  30.0   \n",
       "2018-04-16  13:58:40  123005  万信转债  证券卖出   -30  124.451  3733.53   0.0   \n",
       "2018-04-17  09:33:44  123005  万信转债  证券卖出   -40  125.000  5000.00   0.0   \n",
       "2018-04-17  13:43:35  123005  万信转债  证券买入    20  123.370  2467.40  20.0   \n",
       "2018-04-17  10:00:40  123005  万信转债  证券买入    40  124.360  4974.40  40.0   \n",
       "2018-04-17  10:32:24  123005  万信转债  证券卖出   -40  124.500  4980.00   0.0   \n",
       "2018-04-17  14:13:57  123005  万信转债  证券买入    40  123.500  4940.00  40.0   \n",
       "2018-04-17  13:45:53  123005  万信转债  证券买入    20  123.502  2470.04  40.0   \n",
       "2018-04-17  13:58:43  123005  万信转债  证券卖出   -40  123.500  4940.00   0.0   \n",
       "2018-04-18  14:44:14  123005  万信转债  证券买入    40  129.250  5170.00  40.0   \n",
       "2018-04-18  14:44:59  123005  万信转债  证券卖出   -40  129.500  5180.00   0.0   \n",
       "2018-04-18  10:02:53  123005  万信转债  证券卖出   -40  123.550  4942.00   0.0   \n",
       "2018-04-18  14:23:42  123005  万信转债  证券买入    40  128.250  5130.00  40.0   \n",
       "2018-04-18  14:32:43  123005  万信转债  证券买入    40  129.400  5176.00  40.0   \n",
       "2018-04-18  14:28:44  123005  万信转债  证券卖出   -40  128.690  5147.60   0.0   \n",
       "2018-04-18  14:15:16  123005  万信转债  证券卖出   -40  127.801  5112.04   0.0   \n",
       "2018-04-18  13:04:57  123005  万信转债  证券买入    40  123.671  4946.84  40.0   \n",
       "2018-04-18  14:41:48  123005  万信转债  证券卖出   -40  129.500  5180.00   0.0   \n",
       "2018-04-19  13:39:02  123005  万信转债  证券买入    40  130.220  5208.80  40.0   \n",
       "\n",
       "               发生金额   手续费  印花税  过户费      本次金额  其他费用  交易市场  \n",
       "成交日期                                                       \n",
       "2018-03-16 -6184.49  0.49  0.0  0.0   3901.25   0.0  深圳Ａ股  \n",
       "2018-03-19  6224.50  0.50  0.0  0.0  10148.33   0.0  深圳Ａ股  \n",
       "2018-03-23  6009.02  0.48  0.0  0.0   9203.43   0.0  深圳Ａ股  \n",
       "2018-03-23 -6039.93  0.48  0.0  0.0   3194.41   0.0  深圳Ａ股  \n",
       "2018-03-26  6132.01  0.49  0.0  0.0   6132.96   0.0  深圳Ａ股  \n",
       "2018-03-26 -6030.48  0.48  0.0  0.0      0.95   0.0  深圳Ａ股  \n",
       "2018-03-27 -5067.61  0.41  0.0  0.0  -4030.68   0.0  深圳Ａ股  \n",
       "2018-03-27  5077.59  0.41  0.0  0.0   1046.91   0.0  深圳Ａ股  \n",
       "2018-04-16 -3747.30  0.30  0.0  0.0   1210.87   0.0  深圳Ａ股  \n",
       "2018-04-16 -3738.30  0.30  0.0  0.0   1257.40   0.0  深圳Ａ股  \n",
       "2018-04-16  3764.70  0.30  0.0  0.0   4975.57   0.0  深圳Ａ股  \n",
       "2018-04-16  3752.70  0.30  0.0  0.0   4988.77   0.0  深圳Ａ股  \n",
       "2018-04-16 -3726.30  0.30  0.0  0.0   1262.47   0.0  深圳Ａ股  \n",
       "2018-04-16 -1249.00  0.10  0.0  0.0      8.40   0.0  深圳Ａ股  \n",
       "2018-04-16 -3739.50  0.30  0.0  0.0   1236.07   0.0  深圳Ａ股  \n",
       "2018-04-16  3733.23  0.30  0.0  0.0   4995.70   0.0  深圳Ａ股  \n",
       "2018-04-17  4999.60  0.40  0.0  0.0   5008.00   0.0  深圳Ａ股  \n",
       "2018-04-17 -2467.60  0.20  0.0  0.0   2545.20   0.0  深圳Ａ股  \n",
       "2018-04-17 -4974.80  0.40  0.0  0.0     33.20   0.0  深圳Ａ股  \n",
       "2018-04-17  4979.60  0.40  0.0  0.0   5012.80   0.0  深圳Ａ股  \n",
       "2018-04-17 -4940.40  0.40  0.0  0.0     74.16   0.0  深圳Ａ股  \n",
       "2018-04-17 -2470.24  0.20  0.0  0.0     74.96   0.0  深圳Ａ股  \n",
       "2018-04-17  4939.60  0.40  0.0  0.0   5014.56   0.0  深圳Ａ股  \n",
       "2018-04-18 -5170.41  0.41  0.0  0.0     29.70   0.0  深圳Ａ股  \n",
       "2018-04-18  5179.59  0.41  0.0  0.0   5209.29   0.0  深圳Ａ股  \n",
       "2018-04-18  4941.60  0.40  0.0  0.0   5015.76   0.0  深圳Ａ股  \n",
       "2018-04-18 -5130.41  0.41  0.0  0.0     49.74   0.0  深圳Ａ股  \n",
       "2018-04-18 -5176.41  0.41  0.0  0.0     20.52   0.0  深圳Ａ股  \n",
       "2018-04-18  5147.19  0.41  0.0  0.0   5196.93   0.0  深圳Ａ股  \n",
       "2018-04-18  5111.63  0.41  0.0  0.0   5180.15   0.0  深圳Ａ股  \n",
       "2018-04-18 -4947.24  0.40  0.0  0.0     68.52   0.0  深圳Ａ股  \n",
       "2018-04-18  5179.59  0.41  0.0  0.0   5200.11   0.0  深圳Ａ股  \n",
       "2018-04-19 -5209.22  0.42  0.0  0.0  -4999.98   0.0  深圳Ａ股  "
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[u'证券代码']==u'123005'].sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>成交时间</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>操作</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交均价</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>余额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>本次金额</th>\n",
       "      <th>其他费用</th>\n",
       "      <th>交易市场</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>成交日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2018-03-16</th>\n",
       "      <td>14:03:41</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>50</td>\n",
       "      <td>123.680</td>\n",
       "      <td>6184.00</td>\n",
       "      <td>50.0</td>\n",
       "      <td>-6184.49</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3901.25</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-23</th>\n",
       "      <td>13:23:42</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>50</td>\n",
       "      <td>120.789</td>\n",
       "      <td>6039.45</td>\n",
       "      <td>50.0</td>\n",
       "      <td>-6039.93</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3194.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-26</th>\n",
       "      <td>09:40:35</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>50</td>\n",
       "      <td>120.600</td>\n",
       "      <td>6030.00</td>\n",
       "      <td>50.0</td>\n",
       "      <td>-6030.48</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.95</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-27</th>\n",
       "      <td>10:05:12</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>126.680</td>\n",
       "      <td>5067.20</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5067.61</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-4030.68</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:19:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.900</td>\n",
       "      <td>3747.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3747.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1210.87</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>14:00:45</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.600</td>\n",
       "      <td>3738.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3738.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1257.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:56:59</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.200</td>\n",
       "      <td>3726.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3726.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1262.47</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>14:45:58</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>10</td>\n",
       "      <td>124.890</td>\n",
       "      <td>1248.90</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-1249.00</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>11:08:49</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.640</td>\n",
       "      <td>3739.20</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3739.50</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1236.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:43:35</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>20</td>\n",
       "      <td>123.370</td>\n",
       "      <td>2467.40</td>\n",
       "      <td>20.0</td>\n",
       "      <td>-2467.60</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2545.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>10:00:40</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>124.360</td>\n",
       "      <td>4974.40</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4974.80</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>33.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>14:13:57</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>123.500</td>\n",
       "      <td>4940.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4940.40</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>74.16</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:45:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>20</td>\n",
       "      <td>123.502</td>\n",
       "      <td>2470.04</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-2470.24</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>74.96</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:44:14</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>129.250</td>\n",
       "      <td>5170.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5170.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>29.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:23:42</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>128.250</td>\n",
       "      <td>5130.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5130.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>49.74</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:32:43</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>129.400</td>\n",
       "      <td>5176.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5176.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>13:04:57</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>123.671</td>\n",
       "      <td>4946.84</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4947.24</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>68.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-19</th>\n",
       "      <td>13:39:02</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>130.220</td>\n",
       "      <td>5208.80</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5209.22</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-4999.98</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                成交时间    证券代码  证券名称    操作  成交数量     成交均价     成交金额    余额  \\\n",
       "成交日期                                                                     \n",
       "2018-03-16  14:03:41  123005  万信转债  证券买入    50  123.680  6184.00  50.0   \n",
       "2018-03-23  13:23:42  123005  万信转债  证券买入    50  120.789  6039.45  50.0   \n",
       "2018-03-26  09:40:35  123005  万信转债  证券买入    50  120.600  6030.00  50.0   \n",
       "2018-03-27  10:05:12  123005  万信转债  证券买入    40  126.680  5067.20  40.0   \n",
       "2018-04-16  10:19:53  123005  万信转债  证券买入    30  124.900  3747.00  30.0   \n",
       "2018-04-16  14:00:45  123005  万信转债  证券买入    30  124.600  3738.00  30.0   \n",
       "2018-04-16  13:56:59  123005  万信转债  证券买入    30  124.200  3726.00  30.0   \n",
       "2018-04-16  14:45:58  123005  万信转债  证券买入    10  124.890  1248.90  40.0   \n",
       "2018-04-16  11:08:49  123005  万信转债  证券买入    30  124.640  3739.20  30.0   \n",
       "2018-04-17  13:43:35  123005  万信转债  证券买入    20  123.370  2467.40  20.0   \n",
       "2018-04-17  10:00:40  123005  万信转债  证券买入    40  124.360  4974.40  40.0   \n",
       "2018-04-17  14:13:57  123005  万信转债  证券买入    40  123.500  4940.00  40.0   \n",
       "2018-04-17  13:45:53  123005  万信转债  证券买入    20  123.502  2470.04  40.0   \n",
       "2018-04-18  14:44:14  123005  万信转债  证券买入    40  129.250  5170.00  40.0   \n",
       "2018-04-18  14:23:42  123005  万信转债  证券买入    40  128.250  5130.00  40.0   \n",
       "2018-04-18  14:32:43  123005  万信转债  证券买入    40  129.400  5176.00  40.0   \n",
       "2018-04-18  13:04:57  123005  万信转债  证券买入    40  123.671  4946.84  40.0   \n",
       "2018-04-19  13:39:02  123005  万信转债  证券买入    40  130.220  5208.80  40.0   \n",
       "\n",
       "               发生金额   手续费  印花税  过户费     本次金额  其他费用  交易市场  \n",
       "成交日期                                                      \n",
       "2018-03-16 -6184.49  0.49  0.0  0.0  3901.25   0.0  深圳Ａ股  \n",
       "2018-03-23 -6039.93  0.48  0.0  0.0  3194.41   0.0  深圳Ａ股  \n",
       "2018-03-26 -6030.48  0.48  0.0  0.0     0.95   0.0  深圳Ａ股  \n",
       "2018-03-27 -5067.61  0.41  0.0  0.0 -4030.68   0.0  深圳Ａ股  \n",
       "2018-04-16 -3747.30  0.30  0.0  0.0  1210.87   0.0  深圳Ａ股  \n",
       "2018-04-16 -3738.30  0.30  0.0  0.0  1257.40   0.0  深圳Ａ股  \n",
       "2018-04-16 -3726.30  0.30  0.0  0.0  1262.47   0.0  深圳Ａ股  \n",
       "2018-04-16 -1249.00  0.10  0.0  0.0     8.40   0.0  深圳Ａ股  \n",
       "2018-04-16 -3739.50  0.30  0.0  0.0  1236.07   0.0  深圳Ａ股  \n",
       "2018-04-17 -2467.60  0.20  0.0  0.0  2545.20   0.0  深圳Ａ股  \n",
       "2018-04-17 -4974.80  0.40  0.0  0.0    33.20   0.0  深圳Ａ股  \n",
       "2018-04-17 -4940.40  0.40  0.0  0.0    74.16   0.0  深圳Ａ股  \n",
       "2018-04-17 -2470.24  0.20  0.0  0.0    74.96   0.0  深圳Ａ股  \n",
       "2018-04-18 -5170.41  0.41  0.0  0.0    29.70   0.0  深圳Ａ股  \n",
       "2018-04-18 -5130.41  0.41  0.0  0.0    49.74   0.0  深圳Ａ股  \n",
       "2018-04-18 -5176.41  0.41  0.0  0.0    20.52   0.0  深圳Ａ股  \n",
       "2018-04-18 -4947.24  0.40  0.0  0.0    68.52   0.0  深圳Ａ股  \n",
       "2018-04-19 -5209.22  0.42  0.0  0.0 -4999.98   0.0  深圳Ａ股  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[(df[u'证券代码']==u'123005') & (df[u'操作']==u'证券买入')].sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-4585.78"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "-9795+5209.22"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "640"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[(df[u'证券代码']==u'123005') & (df[u'操作']==u'证券买入')][u'成交数量'].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-600"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[(df[u'证券代码']==u'123005') & (df[u'操作']==u'证券卖出')][u'成交数量'].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>成交时间</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>操作</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交均价</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>余额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>本次金额</th>\n",
       "      <th>其他费用</th>\n",
       "      <th>交易市场</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>成交日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:19:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.900</td>\n",
       "      <td>3747.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3747.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1210.87</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>14:00:45</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.600</td>\n",
       "      <td>3738.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3738.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1257.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:24:24</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>125.500</td>\n",
       "      <td>3765.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3764.70</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4975.57</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:16:02</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>125.100</td>\n",
       "      <td>3753.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3752.70</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4988.77</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:56:59</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.200</td>\n",
       "      <td>3726.00</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3726.30</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1262.47</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>14:45:58</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>10</td>\n",
       "      <td>124.890</td>\n",
       "      <td>1248.90</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-1249.00</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>11:08:49</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>30</td>\n",
       "      <td>124.640</td>\n",
       "      <td>3739.20</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-3739.50</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1236.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:58:40</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>124.451</td>\n",
       "      <td>3733.53</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3733.23</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4995.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>09:33:44</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>125.000</td>\n",
       "      <td>5000.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4999.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5008.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:43:35</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>20</td>\n",
       "      <td>123.370</td>\n",
       "      <td>2467.40</td>\n",
       "      <td>20.0</td>\n",
       "      <td>-2467.60</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2545.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>10:00:40</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>124.360</td>\n",
       "      <td>4974.40</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4974.80</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>33.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>10:32:24</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>124.500</td>\n",
       "      <td>4980.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4979.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5012.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>14:13:57</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>123.500</td>\n",
       "      <td>4940.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4940.40</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>74.16</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:45:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>20</td>\n",
       "      <td>123.502</td>\n",
       "      <td>2470.04</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-2470.24</td>\n",
       "      <td>0.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>74.96</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:58:43</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>123.500</td>\n",
       "      <td>4940.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4939.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5014.56</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:44:14</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>129.250</td>\n",
       "      <td>5170.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5170.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>29.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:44:59</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>129.500</td>\n",
       "      <td>5180.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5179.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5209.29</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>10:02:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>123.550</td>\n",
       "      <td>4942.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4941.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5015.76</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:23:42</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>128.250</td>\n",
       "      <td>5130.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5130.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>49.74</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:32:43</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>129.400</td>\n",
       "      <td>5176.00</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5176.41</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:28:44</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>128.690</td>\n",
       "      <td>5147.60</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5147.19</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5196.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:15:16</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>127.801</td>\n",
       "      <td>5112.04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5111.63</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5180.15</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>13:04:57</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>123.671</td>\n",
       "      <td>4946.84</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-4947.24</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>68.52</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:41:48</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>129.500</td>\n",
       "      <td>5180.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5179.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5200.11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-19</th>\n",
       "      <td>13:39:02</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>40</td>\n",
       "      <td>130.220</td>\n",
       "      <td>5208.80</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-5209.22</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-4999.98</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                成交时间    证券代码  证券名称    操作  成交数量     成交均价     成交金额    余额  \\\n",
       "成交日期                                                                     \n",
       "2018-04-16  10:19:53  123005  万信转债  证券买入    30  124.900  3747.00  30.0   \n",
       "2018-04-16  14:00:45  123005  万信转债  证券买入    30  124.600  3738.00  30.0   \n",
       "2018-04-16  10:24:24  123005  万信转债  证券卖出   -30  125.500  3765.00   0.0   \n",
       "2018-04-16  13:16:02  123005  万信转债  证券卖出   -30  125.100  3753.00   0.0   \n",
       "2018-04-16  13:56:59  123005  万信转债  证券买入    30  124.200  3726.00  30.0   \n",
       "2018-04-16  14:45:58  123005  万信转债  证券买入    10  124.890  1248.90  40.0   \n",
       "2018-04-16  11:08:49  123005  万信转债  证券买入    30  124.640  3739.20  30.0   \n",
       "2018-04-16  13:58:40  123005  万信转债  证券卖出   -30  124.451  3733.53   0.0   \n",
       "2018-04-17  09:33:44  123005  万信转债  证券卖出   -40  125.000  5000.00   0.0   \n",
       "2018-04-17  13:43:35  123005  万信转债  证券买入    20  123.370  2467.40  20.0   \n",
       "2018-04-17  10:00:40  123005  万信转债  证券买入    40  124.360  4974.40  40.0   \n",
       "2018-04-17  10:32:24  123005  万信转债  证券卖出   -40  124.500  4980.00   0.0   \n",
       "2018-04-17  14:13:57  123005  万信转债  证券买入    40  123.500  4940.00  40.0   \n",
       "2018-04-17  13:45:53  123005  万信转债  证券买入    20  123.502  2470.04  40.0   \n",
       "2018-04-17  13:58:43  123005  万信转债  证券卖出   -40  123.500  4940.00   0.0   \n",
       "2018-04-18  14:44:14  123005  万信转债  证券买入    40  129.250  5170.00  40.0   \n",
       "2018-04-18  14:44:59  123005  万信转债  证券卖出   -40  129.500  5180.00   0.0   \n",
       "2018-04-18  10:02:53  123005  万信转债  证券卖出   -40  123.550  4942.00   0.0   \n",
       "2018-04-18  14:23:42  123005  万信转债  证券买入    40  128.250  5130.00  40.0   \n",
       "2018-04-18  14:32:43  123005  万信转债  证券买入    40  129.400  5176.00  40.0   \n",
       "2018-04-18  14:28:44  123005  万信转债  证券卖出   -40  128.690  5147.60   0.0   \n",
       "2018-04-18  14:15:16  123005  万信转债  证券卖出   -40  127.801  5112.04   0.0   \n",
       "2018-04-18  13:04:57  123005  万信转债  证券买入    40  123.671  4946.84  40.0   \n",
       "2018-04-18  14:41:48  123005  万信转债  证券卖出   -40  129.500  5180.00   0.0   \n",
       "2018-04-19  13:39:02  123005  万信转债  证券买入    40  130.220  5208.80  40.0   \n",
       "\n",
       "               发生金额   手续费  印花税  过户费     本次金额  其他费用  交易市场  \n",
       "成交日期                                                      \n",
       "2018-04-16 -3747.30  0.30  0.0  0.0  1210.87   0.0  深圳Ａ股  \n",
       "2018-04-16 -3738.30  0.30  0.0  0.0  1257.40   0.0  深圳Ａ股  \n",
       "2018-04-16  3764.70  0.30  0.0  0.0  4975.57   0.0  深圳Ａ股  \n",
       "2018-04-16  3752.70  0.30  0.0  0.0  4988.77   0.0  深圳Ａ股  \n",
       "2018-04-16 -3726.30  0.30  0.0  0.0  1262.47   0.0  深圳Ａ股  \n",
       "2018-04-16 -1249.00  0.10  0.0  0.0     8.40   0.0  深圳Ａ股  \n",
       "2018-04-16 -3739.50  0.30  0.0  0.0  1236.07   0.0  深圳Ａ股  \n",
       "2018-04-16  3733.23  0.30  0.0  0.0  4995.70   0.0  深圳Ａ股  \n",
       "2018-04-17  4999.60  0.40  0.0  0.0  5008.00   0.0  深圳Ａ股  \n",
       "2018-04-17 -2467.60  0.20  0.0  0.0  2545.20   0.0  深圳Ａ股  \n",
       "2018-04-17 -4974.80  0.40  0.0  0.0    33.20   0.0  深圳Ａ股  \n",
       "2018-04-17  4979.60  0.40  0.0  0.0  5012.80   0.0  深圳Ａ股  \n",
       "2018-04-17 -4940.40  0.40  0.0  0.0    74.16   0.0  深圳Ａ股  \n",
       "2018-04-17 -2470.24  0.20  0.0  0.0    74.96   0.0  深圳Ａ股  \n",
       "2018-04-17  4939.60  0.40  0.0  0.0  5014.56   0.0  深圳Ａ股  \n",
       "2018-04-18 -5170.41  0.41  0.0  0.0    29.70   0.0  深圳Ａ股  \n",
       "2018-04-18  5179.59  0.41  0.0  0.0  5209.29   0.0  深圳Ａ股  \n",
       "2018-04-18  4941.60  0.40  0.0  0.0  5015.76   0.0  深圳Ａ股  \n",
       "2018-04-18 -5130.41  0.41  0.0  0.0    49.74   0.0  深圳Ａ股  \n",
       "2018-04-18 -5176.41  0.41  0.0  0.0    20.52   0.0  深圳Ａ股  \n",
       "2018-04-18  5147.19  0.41  0.0  0.0  5196.93   0.0  深圳Ａ股  \n",
       "2018-04-18  5111.63  0.41  0.0  0.0  5180.15   0.0  深圳Ａ股  \n",
       "2018-04-18 -4947.24  0.40  0.0  0.0    68.52   0.0  深圳Ａ股  \n",
       "2018-04-18  5179.59  0.41  0.0  0.0  5200.11   0.0  深圳Ａ股  \n",
       "2018-04-19 -5209.22  0.42  0.0  0.0 -4999.98   0.0  深圳Ａ股  "
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[u'证券代码']==u'123005']['2018-04']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'2018-04-15'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-45-e75fe7ecaed0>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdf\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'2018-04-15'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mc:\\python27\\lib\\site-packages\\pandas\\core\\frame.pyc\u001b[0m in \u001b[0;36m__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   2137\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_multilevel\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2138\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2139\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_column\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2140\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2141\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_getitem_column\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\python27\\lib\\site-packages\\pandas\\core\\frame.pyc\u001b[0m in \u001b[0;36m_getitem_column\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   2144\u001b[0m         \u001b[1;31m# get column\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2145\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mis_unique\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2146\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_get_item_cache\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2147\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2148\u001b[0m         \u001b[1;31m# duplicate columns & possible reduce dimensionality\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\python27\\lib\\site-packages\\pandas\\core\\generic.pyc\u001b[0m in \u001b[0;36m_get_item_cache\u001b[1;34m(self, item)\u001b[0m\n\u001b[0;32m   1840\u001b[0m         \u001b[0mres\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcache\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1841\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mres\u001b[0m \u001b[1;32mis\u001b[0m \u001b[0mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1842\u001b[1;33m             \u001b[0mvalues\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_data\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1843\u001b[0m             \u001b[0mres\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_box_item_values\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalues\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1844\u001b[0m             \u001b[0mcache\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mitem\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mres\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\python27\\lib\\site-packages\\pandas\\core\\internals.pyc\u001b[0m in \u001b[0;36mget\u001b[1;34m(self, item, fastpath)\u001b[0m\n\u001b[0;32m   3841\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   3842\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0misna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3843\u001b[1;33m                 \u001b[0mloc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   3844\u001b[0m             \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   3845\u001b[0m                 \u001b[0mindexer\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0marange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0misna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\python27\\lib\\site-packages\\pandas\\core\\indexes\\base.pyc\u001b[0m in \u001b[0;36mget_loc\u001b[1;34m(self, key, method, tolerance)\u001b[0m\n\u001b[0;32m   2525\u001b[0m                 \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2526\u001b[0m             \u001b[1;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2527\u001b[1;33m                 \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_maybe_cast_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2528\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2529\u001b[0m         \u001b[0mindexer\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmethod\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmethod\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtolerance\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mtolerance\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: '2018-04-15'"
     ]
    }
   ],
   "source": [
    "df['2018-04-15']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-11.700000000000728"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[u'证券代码']==u'110039'][u'发生金额'].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "372.22000000000025"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "-4837+5209.22"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>成交时间</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>操作</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交均价</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>余额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>本次金额</th>\n",
       "      <th>其他费用</th>\n",
       "      <th>交易市场</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>成交日期</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2018-02-05</th>\n",
       "      <td>13:29:51</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-100</td>\n",
       "      <td>24.960</td>\n",
       "      <td>2496.00</td>\n",
       "      <td>105.0</td>\n",
       "      <td>2488.50</td>\n",
       "      <td>5.00</td>\n",
       "      <td>2.50</td>\n",
       "      <td>0.05</td>\n",
       "      <td>2488.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-02-26</th>\n",
       "      <td>11:22:45</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-105</td>\n",
       "      <td>23.260</td>\n",
       "      <td>2442.30</td>\n",
       "      <td>100.0</td>\n",
       "      <td>2434.86</td>\n",
       "      <td>5.00</td>\n",
       "      <td>2.44</td>\n",
       "      <td>0.05</td>\n",
       "      <td>2435.36</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-02-27</th>\n",
       "      <td>10:10:03</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-100</td>\n",
       "      <td>23.050</td>\n",
       "      <td>2305.00</td>\n",
       "      <td>100.0</td>\n",
       "      <td>2297.69</td>\n",
       "      <td>5.00</td>\n",
       "      <td>2.31</td>\n",
       "      <td>0.05</td>\n",
       "      <td>2463.05</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-01</th>\n",
       "      <td>13:00:06</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-200</td>\n",
       "      <td>24.350</td>\n",
       "      <td>4870.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4860.13</td>\n",
       "      <td>5.00</td>\n",
       "      <td>4.87</td>\n",
       "      <td>0.10</td>\n",
       "      <td>5053.18</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-08</th>\n",
       "      <td>13:00:00</td>\n",
       "      <td>300527</td>\n",
       "      <td>华舟应急</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-100</td>\n",
       "      <td>24.360</td>\n",
       "      <td>2436.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2428.56</td>\n",
       "      <td>5.00</td>\n",
       "      <td>2.44</td>\n",
       "      <td>0.05</td>\n",
       "      <td>4085.74</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-19</th>\n",
       "      <td>11:09:42</td>\n",
       "      <td>110039</td>\n",
       "      <td>宝信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-20</td>\n",
       "      <td>132.120</td>\n",
       "      <td>2642.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2642.39</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>3923.83</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-19</th>\n",
       "      <td>10:59:31</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>124.500</td>\n",
       "      <td>6225.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6224.50</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>10148.33</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-23</th>\n",
       "      <td>09:51:23</td>\n",
       "      <td>113504</td>\n",
       "      <td>N艾华转</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-10</td>\n",
       "      <td>108.510</td>\n",
       "      <td>1085.10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1085.09</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>9234.34</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-23</th>\n",
       "      <td>14:49:25</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>120.190</td>\n",
       "      <td>6009.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6009.02</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>9203.43</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-26</th>\n",
       "      <td>14:30:29</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>122.650</td>\n",
       "      <td>6132.50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6132.01</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>6132.96</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-27</th>\n",
       "      <td>10:32:37</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>126.950</td>\n",
       "      <td>5078.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5077.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>1046.91</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-27</th>\n",
       "      <td>09:25:01</td>\n",
       "      <td>113505</td>\n",
       "      <td>N杭电转</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-10</td>\n",
       "      <td>100.500</td>\n",
       "      <td>1005.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1004.99</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5137.95</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-28</th>\n",
       "      <td>10:14:10</td>\n",
       "      <td>110039</td>\n",
       "      <td>宝信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>135.200</td>\n",
       "      <td>4056.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4055.98</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5102.89</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-29</th>\n",
       "      <td>10:10:36</td>\n",
       "      <td>603168</td>\n",
       "      <td>莎普爱思</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-600</td>\n",
       "      <td>14.180</td>\n",
       "      <td>8508.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8494.32</td>\n",
       "      <td>5.00</td>\n",
       "      <td>8.51</td>\n",
       "      <td>0.17</td>\n",
       "      <td>9505.99</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-03-29</th>\n",
       "      <td>14:12:37</td>\n",
       "      <td>113505</td>\n",
       "      <td>杭电转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>102.360</td>\n",
       "      <td>4094.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4094.38</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>13600.37</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-11</th>\n",
       "      <td>09:32:39</td>\n",
       "      <td>127005</td>\n",
       "      <td>长证转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-10</td>\n",
       "      <td>106.720</td>\n",
       "      <td>1067.20</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1067.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>1067.10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:50:39</td>\n",
       "      <td>110039</td>\n",
       "      <td>宝信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>149.100</td>\n",
       "      <td>4473.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4472.98</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>60.76</td>\n",
       "      <td>0.0</td>\n",
       "      <td>上海Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:24:24</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>125.500</td>\n",
       "      <td>3765.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3764.70</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>4975.57</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>10:18:43</td>\n",
       "      <td>128036</td>\n",
       "      <td>金农转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-50</td>\n",
       "      <td>97.956</td>\n",
       "      <td>4897.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4897.41</td>\n",
       "      <td>0.39</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>4958.17</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:16:02</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>125.100</td>\n",
       "      <td>3753.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3752.70</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>4988.77</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-16</th>\n",
       "      <td>13:58:40</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-30</td>\n",
       "      <td>124.451</td>\n",
       "      <td>3733.53</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3733.23</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>4995.70</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>09:33:44</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>125.000</td>\n",
       "      <td>5000.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4999.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5008.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>10:32:24</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>124.500</td>\n",
       "      <td>4980.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4979.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5012.80</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-17</th>\n",
       "      <td>13:58:43</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>123.500</td>\n",
       "      <td>4940.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4939.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5014.56</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:44:59</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>129.500</td>\n",
       "      <td>5180.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5179.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5209.29</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>10:02:53</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>123.550</td>\n",
       "      <td>4942.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4941.60</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5015.76</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:28:44</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>128.690</td>\n",
       "      <td>5147.60</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5147.19</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5196.93</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:15:16</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>127.801</td>\n",
       "      <td>5112.04</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5111.63</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5180.15</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-04-18</th>\n",
       "      <td>14:41:48</td>\n",
       "      <td>123005</td>\n",
       "      <td>万信转债</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>-40</td>\n",
       "      <td>129.500</td>\n",
       "      <td>5180.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5179.59</td>\n",
       "      <td>0.41</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>5200.11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>深圳Ａ股</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                成交时间    证券代码  证券名称    操作  成交数量     成交均价     成交金额     余额  \\\n",
       "成交日期                                                                      \n",
       "2018-02-05  13:29:51  300527  华舟应急  证券卖出  -100   24.960  2496.00  105.0   \n",
       "2018-02-26  11:22:45  300527  华舟应急  证券卖出  -105   23.260  2442.30  100.0   \n",
       "2018-02-27  10:10:03  300527  华舟应急  证券卖出  -100   23.050  2305.00  100.0   \n",
       "2018-03-01  13:00:06  300527  华舟应急  证券卖出  -200   24.350  4870.00    0.0   \n",
       "2018-03-08  13:00:00  300527  华舟应急  证券卖出  -100   24.360  2436.00    0.0   \n",
       "2018-03-19  11:09:42  110039  宝信转债  证券卖出   -20  132.120  2642.40    0.0   \n",
       "2018-03-19  10:59:31  123005  万信转债  证券卖出   -50  124.500  6225.00    0.0   \n",
       "2018-03-23  09:51:23  113504  N艾华转  证券卖出   -10  108.510  1085.10    0.0   \n",
       "2018-03-23  14:49:25  123005  万信转债  证券卖出   -50  120.190  6009.50    0.0   \n",
       "2018-03-26  14:30:29  123005  万信转债  证券卖出   -50  122.650  6132.50    0.0   \n",
       "2018-03-27  10:32:37  123005  万信转债  证券卖出   -40  126.950  5078.00    0.0   \n",
       "2018-03-27  09:25:01  113505  N杭电转  证券卖出   -10  100.500  1005.00    0.0   \n",
       "2018-03-28  10:14:10  110039  宝信转债  证券卖出   -30  135.200  4056.00    0.0   \n",
       "2018-03-29  10:10:36  603168  莎普爱思  证券卖出  -600   14.180  8508.00    0.0   \n",
       "2018-03-29  14:12:37  113505  杭电转债  证券卖出   -40  102.360  4094.40    0.0   \n",
       "2018-04-11  09:32:39  127005  长证转债  证券卖出   -10  106.720  1067.20    0.0   \n",
       "2018-04-16  10:50:39  110039  宝信转债  证券卖出   -30  149.100  4473.00    0.0   \n",
       "2018-04-16  10:24:24  123005  万信转债  证券卖出   -30  125.500  3765.00    0.0   \n",
       "2018-04-16  10:18:43  128036  金农转债  证券卖出   -50   97.956  4897.80    0.0   \n",
       "2018-04-16  13:16:02  123005  万信转债  证券卖出   -30  125.100  3753.00    0.0   \n",
       "2018-04-16  13:58:40  123005  万信转债  证券卖出   -30  124.451  3733.53    0.0   \n",
       "2018-04-17  09:33:44  123005  万信转债  证券卖出   -40  125.000  5000.00    0.0   \n",
       "2018-04-17  10:32:24  123005  万信转债  证券卖出   -40  124.500  4980.00    0.0   \n",
       "2018-04-17  13:58:43  123005  万信转债  证券卖出   -40  123.500  4940.00    0.0   \n",
       "2018-04-18  14:44:59  123005  万信转债  证券卖出   -40  129.500  5180.00    0.0   \n",
       "2018-04-18  10:02:53  123005  万信转债  证券卖出   -40  123.550  4942.00    0.0   \n",
       "2018-04-18  14:28:44  123005  万信转债  证券卖出   -40  128.690  5147.60    0.0   \n",
       "2018-04-18  14:15:16  123005  万信转债  证券卖出   -40  127.801  5112.04    0.0   \n",
       "2018-04-18  14:41:48  123005  万信转债  证券卖出   -40  129.500  5180.00    0.0   \n",
       "\n",
       "               发生金额   手续费   印花税   过户费      本次金额  其他费用  交易市场  \n",
       "成交日期                                                         \n",
       "2018-02-05  2488.50  5.00  2.50  0.05   2488.50   0.0  深圳Ａ股  \n",
       "2018-02-26  2434.86  5.00  2.44  0.05   2435.36   0.0  深圳Ａ股  \n",
       "2018-02-27  2297.69  5.00  2.31  0.05   2463.05   0.0  深圳Ａ股  \n",
       "2018-03-01  4860.13  5.00  4.87  0.10   5053.18   0.0  深圳Ａ股  \n",
       "2018-03-08  2428.56  5.00  2.44  0.05   4085.74   0.0  深圳Ａ股  \n",
       "2018-03-19  2642.39  0.01  0.00  0.00   3923.83   0.0  上海Ａ股  \n",
       "2018-03-19  6224.50  0.50  0.00  0.00  10148.33   0.0  深圳Ａ股  \n",
       "2018-03-23  1085.09  0.01  0.00  0.00   9234.34   0.0  上海Ａ股  \n",
       "2018-03-23  6009.02  0.48  0.00  0.00   9203.43   0.0  深圳Ａ股  \n",
       "2018-03-26  6132.01  0.49  0.00  0.00   6132.96   0.0  深圳Ａ股  \n",
       "2018-03-27  5077.59  0.41  0.00  0.00   1046.91   0.0  深圳Ａ股  \n",
       "2018-03-27  1004.99  0.01  0.00  0.00   5137.95   0.0  上海Ａ股  \n",
       "2018-03-28  4055.98  0.02  0.00  0.00   5102.89   0.0  上海Ａ股  \n",
       "2018-03-29  8494.32  5.00  8.51  0.17   9505.99   0.0  上海Ａ股  \n",
       "2018-03-29  4094.38  0.02  0.00  0.00  13600.37   0.0  上海Ａ股  \n",
       "2018-04-11  1067.10  0.10  0.00  0.00   1067.10   0.0  深圳Ａ股  \n",
       "2018-04-16  4472.98  0.02  0.00  0.00     60.76   0.0  上海Ａ股  \n",
       "2018-04-16  3764.70  0.30  0.00  0.00   4975.57   0.0  深圳Ａ股  \n",
       "2018-04-16  4897.41  0.39  0.00  0.00   4958.17   0.0  深圳Ａ股  \n",
       "2018-04-16  3752.70  0.30  0.00  0.00   4988.77   0.0  深圳Ａ股  \n",
       "2018-04-16  3733.23  0.30  0.00  0.00   4995.70   0.0  深圳Ａ股  \n",
       "2018-04-17  4999.60  0.40  0.00  0.00   5008.00   0.0  深圳Ａ股  \n",
       "2018-04-17  4979.60  0.40  0.00  0.00   5012.80   0.0  深圳Ａ股  \n",
       "2018-04-17  4939.60  0.40  0.00  0.00   5014.56   0.0  深圳Ａ股  \n",
       "2018-04-18  5179.59  0.41  0.00  0.00   5209.29   0.0  深圳Ａ股  \n",
       "2018-04-18  4941.60  0.40  0.00  0.00   5015.76   0.0  深圳Ａ股  \n",
       "2018-04-18  5147.19  0.41  0.00  0.00   5196.93   0.0  深圳Ａ股  \n",
       "2018-04-18  5111.63  0.41  0.00  0.00   5180.15   0.0  深圳Ａ股  \n",
       "2018-04-18  5179.59  0.41  0.00  0.00   5200.11   0.0  深圳Ａ股  "
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df[u'操作']==u'证券卖出'].sort_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
